<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 mime_types.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.0
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
$page_title = "Mime Types";
include $root_path.'common.php';
include $root_path.'page_header.php';

$template->set_filenames(array(
	'body' => $root_path.$template_path.'server/mime_types.tpl')
);



$system_mime = <<<EOFpacman
<cpanel Mime="system_mime()">
EOFpacman;

$system_mime = explode('</tr>', $system_mime);
$array_of_system_mime = array();

$i = 0;
foreach ($system_mime as $row) {
	$temp = explode('<td>', $row);
	$temp2 = explode('</td>', $temp[1]);
	$array_of_system_mime[$i]['mime'] = trim($temp2[0]);

	$temp2 = explode('</td>', $temp[2]);
	$array_of_system_mime[$i]['extension'] = trim($temp2[0]);


	if ($array_of_system_mime[$i]['mime'] != '') {
		$template->assign_block_vars('systemmimerow', array(
			'ROWCLASS' => ($i%2) ? $template_cfg['class_row_1'] : $template_cfg['class_row_2'],
			'MIME' => $array_of_system_mime[$i]['mime'],
			'EXTENSION' => $array_of_system_mime[$i]['extension'],
			)
		);
		$i++;
	};
};



$user_mime = <<<EOFpacman
<cpanel Mime="user_mime()">
EOFpacman;

$user_mime = explode('</tr>', $user_mime);
$array_of_user_mime = array();

$i = 0;
foreach ($user_mime as $row) {
	$temp = explode('<td>', $row);
	$temp2 = explode('</td>', $temp[1]);
	$array_of_user_mime[$i]['mime'] = trim($temp2[0]);

	$temp2 = explode('</td>', $temp[2]);
	$array_of_user_mime[$i]['extension'] = trim($temp2[0]);


	if ($array_of_user_mime[$i]['mime'] != '') {
		$template->assign_block_vars('usermimerow', array(
			'ROWCLASS' => ($i%2) ? $template_cfg['class_row_1'] : $template_cfg['class_row_2'],
			'MIME' => $array_of_user_mime[$i]['mime'],
			'EXTENSION' => $array_of_user_mime[$i]['extension'],
			'U_DELETE' => 'mime_types_delete.php?mime='.$array_of_user_mime[$i]['mime'],
			)
		);
		$i++;
	};
};


$template->assign_vars(array(
	'S_ACTION' => "mime_types_create_done.php",
));


//
// Woohoo! All done!
//
$template->pparse('body');




include $root_path.'page_tail.php';


?>